package com.ctshk.app.hotel.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.hotel.req.cache.HotelCacheOpsReq;
import com.ctshk.rpc.hotel.service.IHotelH5Service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @description 酒店
 * @author 谢诗宏
 * @date 2021/5/24
 */
@RestController
@RequestMapping("/cache")
@Api(value = "酒店初始化",tags = "酒店初始化C端-H5")
public class HotelCacheController extends BaseController {

    @DubboReference
    private IHotelH5Service hotelH5Service;

    @ApiOperation(value="缓存初始化", notes="酒店-缓存初始化")
    @PostMapping("/init")
    public Result cacheInit(){
       return hotelH5Service.cacheInit();
    }

    @ApiOperation(value="缓存更新", notes="酒店-缓存更新")
    @GetMapping("/update")
    public Result cacheUpdate(@RequestParam Long id){
        hotelH5Service.cacheUpdate(id);
        return Result.success();
    }

}
